package com.tsystems.tuni.sportplanet.ws;

import java.util.List;

import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebService;

import com.tsystems.tuni.sportplanet.businesslogic.ReadDataBeanImpl;
import com.tsystems.tuni.sportplanet.businesslogic.accessinterfaces.ReadDataBeanLocal;
import com.tsystems.tuni.sportplanet.entity.Game;
import com.tsystems.tuni.sportplanet.entity.Player;
import com.tsystems.tuni.sportplanet.entity.Sport;
import com.tsystems.tuni.sportplanet.entity.Team;

@WebService(endpointInterface = "com.tsystems.tuni.sportplanet.ws.ReadDataWS")
public class ReadDataWSImpl implements ReadDataWS {
	@EJB
	private ReadDataBeanLocal dbBean;
	
	public ReadDataWSImpl(){
		dbBean = new ReadDataBeanImpl();
	}

	@Override
	@WebMethod
	public List<Sport> getAllSports() {
		return dbBean.getAllSports();
	}

	@Override
	@WebMethod
	public List<Team> getSportTeams(Sport sport) {
		return dbBean.getSportTeams(sport);
	}

	@Override
	@WebMethod
	public List<Player> getTeamsPlayer(Team team) {
		return dbBean.getTeamsPlayer(team);
	}

	@Override
	@WebMethod
	public List<Game> getGamesBySport(Sport sport) {
		return dbBean.getGamesBySport(sport);
	}
}